/*
* ECARX Technology Limited is the owner of the copyright and the trade secret of this software.
* Without permission, no one has the right to obtain, disclose or use this software in any way.
*/

package ecarx.xsf.notificationcenter.sdk;


import androidx.annotation.IntDef;
import androidx.annotation.StringDef;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;

import static java.lang.annotation.RetentionPolicy.SOURCE;


/**
 * FileName: ILauncherControllerAPI.java <br>
 * Description : Launcher Controller SDK API<br>
 * Create Time: 2021/9/2 14:35 <br>
 * Update Time: 2021/9/2 14:35 <br>
 *
 * @since 1.0.0
 */
public interface IEASLauncherControllerAPI {

    /**
     * 通知样式
     */
    @Retention(SOURCE)
    @Documented
    @IntDef({STYLE_TYRANT, STYLE_SMART_TIPS, STYLE_BADGE, STYLE_SMART_CARD, STYLE_LANDING_PAGE})
    @interface Style {
    }

    /**
     * 霸屏通知
     */
    int STYLE_TYRANT = 1;

    /**
     * 智能提示
     */
    int STYLE_SMART_TIPS = 2;

    /**
     * 智能角标
     */
    int STYLE_BADGE = 3;

    /**
     * 智能卡片
     */
    int STYLE_SMART_CARD = 4;

    /**
     * landing page 样式
     */
    int STYLE_LANDING_PAGE = 5;

    @Retention(SOURCE)
    @Documented
    @IntDef({RESULT_FAIL, RESULT_OK, RESULT_UNKNOWN})
    @interface Result {
    }

    int RESULT_UNKNOWN = 404;

    /**
     * 消息发送返回结果，成功
     */
    int RESULT_OK = 1;

    /**
     * 消息发送返回结果，失败
     */
    int RESULT_FAIL = -1;


    @Retention(SOURCE)
    @Documented
    @StringDef({SUBSTYLE_HEAVY, SUBSTYLE_LIGHT})
    @interface SubStyle {
    }

    /**
     * 智能消息重提醒，一般以卡片形式
     */
    String SUBSTYLE_HEAVY = "heavy";

    /**
     * 智能消息轻提醒，一般是小气泡形式
     */
    String SUBSTYLE_LIGHT = "light";



    /**
     * * 发送消息.
     * <p> 消息发送接口 <br>
     * @since 1.0.0
     * @param notification {@link AbstractBaseNotification} 消息实体
     * @return 返回结果
     */
    @Result
    int notify(AbstractBaseNotification notification);

    /**
     * * 取消消息.
     * <p> 取消消息接口 <br>
     * @since 1.0.0
     * @param notification {@link AbstractBaseNotification} 消息实体
     * @return {@link Result} 返回结果
     */
    @Result
    int cancel(AbstractBaseNotification notification);
}
